﻿using System;
using System.Collections.Generic;

namespace SmartSpace.Silverlight
{
    public interface IHeaderPanel
    {
        /// <summary>
        /// 初始化函数
        /// </summary>
        /// <param name="shortcuts">快捷方式</param>
        /// <param name="applications">应用程序集合</param>
        /// <param name="currentApplication">当前应用程序</param>
        /// <param name="user">登陆用户</param>
        void Initiate(IEnumerable<SlShortcut> shortcuts, List<SlApplication> applications, SlApplication currentApplication, SlUser loginUser);

        /// <summary>
        /// 注销事件
        /// </summary>
        event LogoffEventHandler Logoff;

        /// <summary>
        /// 进入管理页面事件
        /// </summary>
        event EventHandler EnterManagement;

        /// <summary>
        /// 切换应用程序事件
        /// </summary>
        event ChangeAppEventHandler ChangeApp;

        event NavigatingEventHandler Navigating;
    }

    public class LogoffEventArgs : EventArgs
    {
        public SlUser User { get; private set; }
        public LogoffEventArgs(SlUser user)
        {
            User = user;
        }
    }

    public delegate void LogoffEventHandler(object sender, LogoffEventArgs e);

    public class ChangeAppEventArgs : EventArgs
    {
        public SlApplication App { get; set; }

        public ChangeAppEventArgs(SlApplication app)
        {
            App = app;
        }
    }

    public delegate void ChangeAppEventHandler(object sender, ChangeAppEventArgs e);
}
